package com.student.system.wapper;

import com.student.system.vo.MyPageInfo;

import javax.servlet.http.HttpServletRequest;

/***
 * 封装类
 */
public class Wrapper {
    public static MyPageInfo wrapperMyPageInfo(HttpServletRequest req){
        MyPageInfo myPageInfo = new MyPageInfo();
        String search = req.getParameter("search");
        if(search != null){
            myPageInfo.setSearch(search);
        }
        String pageNum = req.getParameter("pageNum");
        if(pageNum != null){
            try{
                myPageInfo.setPageNum(Integer.parseInt(pageNum));
            }catch (Exception e){}

        }
        String pageSize = req.getParameter("pageSize");
        if(pageSize != null){
            try{
                myPageInfo.setPageSize(Integer.parseInt(pageSize));
            }catch (Exception e){}

        }
        return myPageInfo;

    }
}
